<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<table></table>
<script>
    let table = document.querySelector("table");
    let thead = table.createTHead();
    let tbody = table.createTBody();

    let tr = thead.insertRow(0);
    for (let i = 0; i < 10; i++) {
        let td = tr.insertCell(0);
        td.textContent = "序号" + i;
        console.log(td.cellIndex);
    }
    console.log(tr.cells[9].remove());
    console.log(tr.deleteCell(2));
</script>
</body>
</html>